package acm.pta;

import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        boolean[] set=new boolean[256];
        Scanner sc=new Scanner(System.in);
        char[] chars1 = sc.nextLine().toCharArray();
        char[] chars2 = sc.nextLine().toCharArray();
        //O(n)+O(m)的时间复杂度
        for (char c : chars2) {
            set[c]=true;
        }
//        StringBuilder str=new StringBuilder();
        for (char c : chars1) {
            if (!set[c]) {
                System.out.print(c);
            }
        }
//        System.out.println(str);
    }
}